"""meiduo URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path,include
from rest_framework_jwt.views import obtain_jwt_token

from meiduo.settings import *
from users.views import *

urlpatterns = [
    path('admin/', admin.site.urls),
    path('users/',include('users.urls')),
    path('sadmin/',include('sadmin.urls')),
    path('regis/', Regis.as_view()),  # 用户注册
    path('login/', Login_view.as_view()),  # 用户登录 + 修改密码
    # path("login_1/", obtain_jwt_token),  # jwt的认证接口（路径可自定义任意命名）

    # path('cheshi/', Cheshi.as_view()), # 测试
    path('image/', ImageCode.as_view()),  # 图形验证
    path('shouji/', Shouji.as_view()),  # 短信验证
    path('bindemail/', BindEmail.as_view()),  # 邮箱绑定
    path('youxiang/', Youxiang.as_view()),  # 邮箱绑定回调接口
    path('area/', Area_view.as_view()),  # 获取三级区域
    path('address/', Address_view.as_view()),  # 添加收货地址
    path('retrieve/', Retrieve_pwd_view.as_view()),  # 用户找回密码邮箱接口   测试
    path('zh_pwd/', Zh_pwd.as_view()),  # 用户找回密码回调   测试
    path('geturl/', Get_url.as_view()),  # 三方登录 微博
    path('checkuser/', Checkuser.as_view()),  # 三方登录 微博 查询用户表
    path('home/', Home.as_view()),  # 首页分类获取
    path('news/', News_view.as_view()),  # 首页新闻
    path('get_cls_list/', Goods_cls_list.as_view()),  # 分类商品
    path('get_good/',Get_goods.as_view()),  # 获取商品详情
    path('goods_cart/',Cart_view.as_view()),  # 添加到购物车
    # path('cart_selectall/',Cart_selectall_view.as_view()),  # 购物车全选 单选1

    path('cart_goods/',Cart_goods.as_view()),  # 获取购物车信息
    path('check_all/',Check_all.as_view()),  # 全选+单选+删除+修改数量

    path('goods_cart_order/',Goods_cart_order.as_view()),  # 生成订单
    path('pay/',Pay.as_view()),  # 支付宝接口


    path('user_order/',User_order.as_view()),  # 用户订单详情页



]+static(MEDIA_URL,document_root=MEDIA_ROOT)

